// 导入 cookie 操作包
import Cookies from 'js-cookie'


//定义一个 toke 唯一标识
const TokenKEY = 'hrsaas-toke'


//获取 token
export function getToken() {
  return Cookies.get(TokenKEY)
}

//保存 token
export function setToken(value) {
  Cookies.set(TokenKEY, value)
}

//删除 token 
export function removeToken() {
  Cookies.remove(TokenKEY)
}
//定义一个时间戳的唯一标识
const TimeStemp = 'token-time'
//保存时间戳
export function setTimeStamp() {
  Cookies.set(TimeStemp, Date.now())
}
//获取保存的时间戳
export function getTimeStamp() {
  return Cookies.get(TimeStemp)
}
